export const initThreadId = () => {
  return Math.random().toString(36).substring(2, 15);
};
const encoder = new TextEncoder();
export const createSSEData = (data: any): Uint8Array => {
  return encoder.encode(responseText(data));
};

export const responseText = (data: Record<string, any>) => {
  return `data: ${JSON.stringify(data)}\n\n`;
};
